<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var year = prompt('请输入哪年') * 1
        var month = prompt('请输入哪月') * 1
        var day = prompt('请输入哪日') * 1
        if ((year % 4 == 0 && year % 100 != 0 || year / 400 == 0) && month > 2) {
            day += 1;
        }
        else {
            day += 0;
        }
        switch (month) {
            case 12:
                day += 30;
            case 11:
                day += 31;
            case 10:
                day += 30;
            case 9:
                day += 31;
            case 8:
                day += 31;
            case 7:
                day += 30;
            case 6:
                day += 31;
            case 5:
                day += 30;
            case 4:
                day += 31;
            case 3:
                day += 28;
            case 2:
                day += 31;
        }
        console.log(alert('是这年的第' + day + '天哦'))

    </script>

</body>

</html>